from django.db import models

from utils.base import BaseModel


# Create your models here.
class Course(BaseModel):
    cname = models.CharField(max_length=255,default='',blank=True,null=True)
    parent = models.ForeignKey('self',on_delete=models.CASCADE,blank=True,null=True,default=None,related_name="children")
    ishome = models.BooleanField(default=True,blank=True,null=True)
    isgood = models.BooleanField(default=True,blank=True,null=True)
    class Meta:
        db_table = 'course'
        verbose_name = '分类'
    def __str__(self):
        return self.cname